﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace WebPattern.Core.MultiCulture
{
    public enum CultureKey : byte
    {
        Default = 0,
        ro,
        roRO,

        ru,
        ruRU,

        en,
        enUS,
        enGB

        // ......... // Add more if you need
    }
    
    public static class MultiCultureHelper
    {
        private static Dictionary<CultureKey, string> _cultureCode = new Dictionary<CultureKey, string>();        
        
        static MultiCultureHelper()
        {
            _cultureCode.Add(CultureKey.Default, "default");
            _cultureCode.Add(CultureKey.ro, "ro");
            _cultureCode.Add(CultureKey.roRO, "ro-RO");
            _cultureCode.Add(CultureKey.ru, "ru");
            _cultureCode.Add(CultureKey.ruRU, "ru-RU");
            _cultureCode.Add(CultureKey.en, "en");
            _cultureCode.Add(CultureKey.enGB, "en-GB");
            _cultureCode.Add(CultureKey.enUS, "en-US");
            //  ................................... // Add more if you need
        }

        /// <summary>
        /// Cultures Dictionary
        /// </summary>
        public static Dictionary<CultureKey, string> CultureCodeDic { get { return _cultureCode; } }

        /// <summary>
        /// Return all cultures code.
        /// </summary>
        /// <returns></returns>
        public static string[] GetAllCultureCode()
        {
            string[] retValue = new string[_cultureCode.Count];

            int cont = 0;
            foreach (var cCode in _cultureCode)
            {
                retValue[cont++] = cCode.Value;
            }

            return retValue;
        }
    }
}
